package org.esprit.ocm.client.rpc.oca;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.ServiceDefTarget;

public interface VMOcaServiceAsync
{

    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void listAll( java.lang.String secret, java.lang.String endpoint, int filter, AsyncCallback<java.util.List<org.esprit.ocm.model.oca.VmOca>> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void allocate( java.lang.String secret, java.lang.String endpoint, java.lang.String template, AsyncCallback<java.lang.String> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void delete( java.lang.String secret, java.lang.String endpoint, int vmId, AsyncCallback<java.lang.String> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void info( java.lang.String secret, java.lang.String endpoint, int vmId, AsyncCallback<org.esprit.ocm.model.oca.VmOca> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void hold( java.lang.String secret, java.lang.String endpoint, int vmId, AsyncCallback<java.lang.String> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void release( java.lang.String secret, java.lang.String endpoint, int vmId, AsyncCallback<java.lang.String> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void deploy( java.lang.String secret, java.lang.String endpoint, int vmId, int hostId, AsyncCallback<java.lang.String> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void migrate( java.lang.String secret, java.lang.String endpoint, int vmId, int hostId, AsyncCallback<java.lang.String> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void liveMigrate( java.lang.String secret, java.lang.String endpoint, int vmId, int hostId, AsyncCallback<java.lang.String> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void shutdown( java.lang.String secret, java.lang.String endpoint, int vmId, AsyncCallback<java.lang.String> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void cancel( java.lang.String secret, java.lang.String endpoint, int vmId, AsyncCallback<java.lang.String> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void stop( java.lang.String secret, java.lang.String endpoint, int vmId, AsyncCallback<java.lang.String> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void suspend( java.lang.String secret, java.lang.String endpoint, int vmId, AsyncCallback<java.lang.String> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void resume( java.lang.String secret, java.lang.String endpoint, int vmId, AsyncCallback<java.lang.String> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void finalize( java.lang.String secret, java.lang.String endpoint, int vmId, AsyncCallback<java.lang.String> callback );


    /**
     * GWT-RPC service  asynchronous (client-side) interface
     * @see org.esprit.ocm.client.rpc.oca.VMOcaService
     */
    void restart( java.lang.String secret, java.lang.String endpoint, int vmId, AsyncCallback<java.lang.String> callback );


    /**
     * Utility class to get the RPC Async interface from client-side code
     */
    public static final class Util 
    { 
        private static VMOcaServiceAsync instance;

        public static final VMOcaServiceAsync getInstance()
        {
            if ( instance == null )
            {
                instance = (VMOcaServiceAsync) GWT.create( VMOcaService.class );
                ServiceDefTarget target = (ServiceDefTarget) instance;
                target.setServiceEntryPoint( GWT.getModuleBaseURL() + "VMOcaService.rpc" );
            }
            return instance;
        }

        private Util()
        {
            // Utility class should not be instanciated
        }
    }
}
